<template>
  <div class="">
    <div class="box-title">科室资产盘点情况</div>
    <div class="data-table">
      <div class="table-head fss">
        <div class="col1 fsc">科室</div>
        <div class="col2 fsc">总资产(元)</div>
        <div class="col3 fsc">盘点状态</div>
        <div class="col4 fsc">结束时间</div>
      </div>
      <div class="scrollbar table-body">
        <div class="row fss" v-for="(item,index) in list" :key="index">
          <div class="col1 fsc">{{item.Name}}</div>
          <div class="col2 fsc">{{moneyFormat(item.Amount||0)}}</div>
          <div class="col3 fsc">{{item.State}}</div>
          <div class="col4 fsc">{{item.ComplateTime}}</div>
        </div>
      </div>
      
    </div>
  </div>
</template>

<script> 
export default {
  name: "box5",
  props:{
    chooseBatch:String,
    moneyFormat:Function,
  },
  data() {
    return {
      list: [
        {Name:'呼吸与危重症医学科',Amount:36885246.20,State:1,ComplateTime:'2022-06-06 13:16:54'},
        {Name:'预防保健科',Amount:36885246.20,State:1,ComplateTime:'2022-06-06 13:16:54'},
        {Name:'眼科',Amount:36885246.20,State:1,ComplateTime:'2022-06-06 13:16:54'},
        {Name:'心血管内科二病区',Amount:36885246.20,State:1,ComplateTime:'2022-06-06 13:16:54'},
        {Name:'神经外科',Amount:36885246.20,State:1,ComplateTime:'2022-06-06 13:16:54'},
      ],
    };
  },
  mounted() {
    // this.refresh();
    // setInterval(this.refresh, 10 * 1000);
    this.getData()
  },
  methods: {
    // async refresh() {
    //   const res = await this.$http.get(
    //     `/api/RepairReport/RepairLargeScreenModelEList`
    //   );

    //   this.list = res.map((v) => ({
    //     ...v,
    //     time: calcTimeDiffFormatter(v.ApplyTime),
    //     content: `${v.DeptName},${v.EqName} ${v.ProblemDec}`,
    //     people1: v.ApplyName,
    //     people2: v.RepairName,
    //   }));
    // },
    getData(){
      this.$http.get(`/api/StocktakingAccountReport/StocktakingReportD/${this.chooseBatch||'$'}`)
        .then(res=>{
           
          this.list=res
        })
    }
  },
  watch:{
    chooseBatch(){
      this.getData()
    }
  }
};
</script>

<style scoped>
  .box-title{
    font-size: 18px;
    font-family: Microsoft YaHei, Microsoft YaHei-Regular;
    font-weight: 400;
    text-align: LEFT;
    color: #d6e2ff;
    line-height: 22px;
    padding: 16px 0 0 24px;
  }
  .data-table{
    width: 100%;
    height: calc(40vh - 75px);
    margin-top: 32px;
    font-family: Microsoft YaHei, Microsoft YaHei-Regular;
    font-weight: 400;
    text-align: LEFT;
    color: #d6e2ff;
    line-height: 18px;
    overflow: hidden;
  }
  .table-body{
    height: calc(40vh - 125px);
    overflow-x: hidden;
    overflow-y: auto;
  }
  .data-table .table-head{
    height: 50px;
    font-size: 18px;
    background: #001b3e;
  }
  .data-table .row{
    width: 100%;
    height: 50px;
  }
  .data-table .col1{
    width: 26%;
    flex: 0 0 26%;
    height: 100%;
    padding-left:32px;
    font-size: 16px;
    line-height: 16px;
  }
  .data-table .col2{
    width: 23%;
    flex: 0 0 23%;
    height: 100%;
    padding-left:32px;
    font-size: 16px;
    line-height: 16px;
  }
  .data-table .col3{
    width: 24%;
    flex: 0 0 24%;
    height: 100%;
    padding-left:32px;
    font-size: 16px;
    line-height: 16px;
  }
  .data-table .col4{
    width: 27%;
    flex: 1;
    height: 100%;
    padding-left:32px;
    font-size: 16px;
    line-height: 16px;
  }
</style>